<%@page import="com.wanmait.cookBook.vo.Pagers"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.wanmait.cookBook.vo.Topic"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%String path =request.getContextPath();%>

<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>最新话题 </title>

<meta http-equiv="mobile-agent" content="format=xhtml; url=https://m.meishichina.com/pai/new/">
<link rel="alternate" media="only screen and (max-width: 640px)"  href="https://m.meishichina.com/pai/new/">
<link rel="shortcut icon" href="https://static.meishichina.com/v6/img/lib/f.ico"/>
<link rel="apple-touch-icon" href="https://static.meishichina.com/v6/img/lib/wapico.png" />
<link rel="stylesheet" type="text/css" href="https://static.meishichina.com/v6/css/lib/all.css?v1=13">
<link rel="stylesheet" type="text/css" href="https://static.meishichina.com/v6/css/app/suipai/pai2.css?v1=2018-10-13" />
</head>
<body>

<!-- logo+nav -->

<div class="w logo_wrap2">
	<div class="logo_inner left">
		<a href="" title="美食天下">美食天下</a>
	</div>
	<div class="logo_current left">
		
		<h1><a href="javascript:void(0)" >话题</a></h1>

	</div>
	

<div class="logo_search right">
<div class="searchBox J_search">
<!-- 搜索的form表单开始 -->
<form method="post" action="<%=path %>/TopicServlet?action=getAllTopic" >
<input type="submit"  value="搜索" title="搜索" class="search_Btn J_searchBTN right" id=""><input type="text" id="myform" name="topicName" class="search_Text J_searchTxt right" placeholder="话题搜索">
</form>
</div>

	</div>

	<div class="logo_nav">
	<a href="<%=path %>/IndexServlet" >首页<i></i><b></b></a>
	<a class="on" href="" title="话题">话题<i></i><b></b></a>
	<a href="" title="日志">日志<i></i><b></b></a>
	<a href="" title="活动">菜谱<i></i><b></b></a>
	</div>

</div>


<div class="w mt10 clear">
	<iframe width="100%" height="90" frameborder="0" scrolling="no" src="https://static.meishichina.com/v6/h5/t1_1.html?v=2"></iframe>
</div>

<div class="wrap">
	<div class="w clear">
		<div class="space_left">
			
<div class="ui_title">
<div class="ui_title_wrap clear ">
<h2 class="on">
<%ArrayList<Topic> allTopics=(ArrayList<Topic>)request.getAttribute("allTopics"); %>
话题</h2>


<a class="right on" href="javascript:void(0)">全部</a>
</div>
</div>
<div class="pin_list clear" id="J_list">				
<ul>
<%for(Topic topic:allTopics){%>
	
			
<li >
	<div class="u">
		<a href="javascript:void(0);" target="_blank" title="逝去的爱情"><img width="40" height="40" class="imgLoad" src="<%=path %>/front/userImages/<%=topic.getUserinfo().getUserFace() %>"  ></a>
		<div>
			<a href="" class="t" target="_blank" title="逝去的爱情"><%=topic.getUserinfo().getUserName() %></a>
			
			<span><% SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
             String time = format.format(topic.getPublishTime());        		 
             %> 
            <%=time %>发布 </span>
				
		</div>
	</div>

	<div class="c clear" >
		<div class="pp">
		 <a href="<%=path %>/ShowDetailedTopicServlet?action=<%=topic.getId() %>&userinfoId=<%=topic.getUserinfo().getId() %>" target="_blank"><strong><%=topic.getTopicName() %></strong><br><%=topic.getContext() %></a></div>

<a class="clear" href="" target="_blank">
						<img  class="imgLoad" src="<%=path%>/front/topicImages/<%=topic.getTopicImage() %>"  >
												<img  class="imgLoad" src="<%=path%>/front/topicImages/<%=topic.getTopicImage() %>"  >
									</a>
<div data-id="1137099" class="f"></div>
<div class="num"><span></span></div>
	</div>

</li>
<% } %>

</ul>
								
			</div>
                             <!-- ******************分页的div************************** -->
				
						<div class="ui-page mt20">
						
 <%Pagers pagers =(Pagers)request.getAttribute("pagers"); %>						
				<%
	String topicName = request.getParameter("topicName");//文本框输入的字 因为转发 是一个request
	topicName = topicName==null?"":topicName;
	%>
				
				
				
					
				<div class="ui-page-inner">
				<a href="<%=path %>/TopicServlet?topicName=<%=topicName %>&action=getAllTopic&pageNo=<%=pagers.getPageNo()-1%>">上一页</a>	

<%
				for(int i=1;i<=pagers.getPageCount();i++){%>								
<a class="" href="<%=path %>/TopicServlet?topicName=<%=topicName %>&action=getAllTopic&pageNo=<%=i%>"><%=i %></a>
<%	
				}			
				%>	

<span>...</span>
<a href="<%=path %>/TopicServlet?topicName=<%=topicName %>&action=getAllTopic&pageNo=<%=pagers.getPageNo()+1%>">下一页</a>
</div>
			</div>
					</div>

		<div class="space_right">
			<a class="r_pai-add" target="_blank" href="<%=path %>/front/publishTopic.jsp">发布话题</a>
<div class="mt20">
<a title="美食天下客户端" href="" target="_blank">
<script>
document.write('<img width="300" height="600" src="//static.meishichina.com/v6/img/blank.gif" data-src="//static.meishichina.com/v6/img/center/r'+Math.floor(Math.random()*5)+'.jpg" class="imgLoad">')
</script>
</a>
</div> 
		</div>
	</div>
</div>

<jsp:include page="/front/footer.jsp" ></jsp:include>
</div>
<!-- 引用全站js -->
<script type="text/javascript" src="//static.meishichina.com/v6/js/lib/all.js?v1=20180922"></script>
<script type="text/javascript">
msc.goTop.init();
msc.user.init();
$("img.imgLoad").imgLoad();
$("#search").click(function(){var q=$("#q").val().replace(/\s+/g,"").replace("　","");window.location.href='https://home.meishichina.com/search/'+(q==""?'':q+'/')});$("#q").keydown(function(e){if(e.keyCode==13)$("#search").click()});
</script>

<script>
$("li.top_bar_more").hoverDelay(function(){$("li.top_bar_more div").show()},function(){$("li.top_bar_more div").hide()},200,200);var _hmt=_hmt||[];(function(){var hm=document.createElement("script");hm.src="//hm.baidu.com/hm.js?fb9cd9dcdda23cee0c7357db9be24acb";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm,s)})();
</script>
<!-- 表单提交的事件 -->
<sctipt src="<%=path %>/front/js/jquery-3.5.0.min.js"></sctipt>
<script>
</script>
 </body>
</html>
